/* 
 * File:   authn.h
 * Author: Kevin Cheung
 *
 */

#ifndef AUTHN_H
#define	AUTHN_H

#include "nweb.h"

#ifdef	__cplusplus
extern "C" {
#endif

/* Data Structures */
typedef struct {
    char* auth_type;
    char* auth_user_file;
} auth_config;

/* function pointer or authentication provider */
typedef int (*authn_provider) (request_rec *r);

/* Authentication Strategies */
int authenticate_default(request_rec *r);

/* Authentication handlers */
int (*run_check_user_id)(request_rec *r);

/* Authentication utility functions */
auth_config* get_auth_config(request_rec *r);
authn_provider lookup_provider(const char *provider_name);
void register_authn_provider(request_rec *r);

#ifdef	__cplusplus
}
#endif

#endif	/* AUTHN_H */

